// 获取微信登陆所需参数
type providerType = "weixin" | "qq" | "sinaweibo" | "xiaomi" | "apple" | "univerify";

export const getwxLoginParams = (provider: providerType) :Promise<UniApp.LoginRes> => {
  return new Promise((resolve, reject) => {
    uni.showLoading({ title: "加载中", mask: true });
    uni.login({
      provider: provider,
      success: (loginParams: UniApp.LoginRes) => {
        uni.hideLoading();
        resolve(loginParams);
      },
      fail: (err: any) => {
        reject(err);
      }
    })
  })
}
